<?php
session_start();
/*
note:
this is just a static test version using a hard-coded countries array.
normally you would be populating the array out of a database

the returned xml has the following structure
<results>
	<rs>foo</rs>
	<rs>bar</rs>
</results>
*/

	require 'db/configuration.php';
	require 'crud/CustomSecurity.class.php';
	require 'common/Utility.php';
	require 'crud/Tsmetki.class.php';
	
	$crud = new Tsmetki(con());
	
	$input = mb_strtolower( $_GET['q'], "UTF-8" );
//	$input = $_GET['q']; 
	$aResults = $crud->getSmetkiShortDescr($input);
	for ($i=0;$i<count($aResults);$i++)	{
		echo $aResults[$i][0]."\n";
	}
	
	function transformToArray($darray){
		$result = array();
		if(count($darray)==0) {
			return $result;
		}
		for ($i=0;$i<count($darray[0]);$i++) {
			$result =$darray[0][$i];
		}
		return $result;
	}
?>